﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace SMS
{
    public partial class fHethong : Form
    {
        fLogin main;
        public fHethong (fLogin main1)
        {
            InitializeComponent();
            main = main1;
        }


        private void txtDangxuat_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            main.Visible = true;
        }

        private void ttDoiMatKhau_Click(object sender, EventArgs e)
        {
            main.DoiMatKhau.ShowDialog();
        }

        private void bntCauHinh_Click_1(object sender, EventArgs e)
        {
            //main.CauHinhKetNoi.ShowDialog();
        }

        private void btnQuanLyKhachHang_Click_1(object sender, EventArgs e)
        {
            this.Visible = false;
            main.QuanLyKhachHang.Visible = true;
            main.QuanLyKhachHang.fQuanlykhachhang_Load(null, null);
        }

        private void btnQuanLyXe_Click_1(object sender, EventArgs e)
        {
            this.Visible = false;
            main.QuanLyXe.Visible = true;
            main.QuanLyXe.fQuanlyxe_Load(null,null);
        }

        private void bntQuanLyTinNhan_Click_1(object sender, EventArgs e)
        {
            this.Visible = false;
            main.QuanLyTinNhan.fQuanlytinnhan_Load(null, null);
            main.QuanLyTinNhan.Visible = true;
        }

        private void btnQuanLyTaiKhoan_Click_1(object sender, EventArgs e)
        {
            this.Visible = false;
            main.QuanLyTaiKhoan.Visible = true;
            main.QuanLyTaiKhoan.FQuanlytaikhoan_Load_1(null,null);
        }

 
        private void ttMayTinh_Click_1(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("calc");

        }

        private void ttQuanLyKhachHang_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            main.QuanLyKhachHang.Visible = true;
            main.QuanLyKhachHang.fQuanlykhachhang_Load(null, null);
        }

        private void quảnLýTàiKhoảnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            main.QuanLyTaiKhoan.Visible = true;
            main.QuanLyTaiKhoan.FQuanlytaikhoan_Load_1(null, null);
        }

        private void ttQuanLyXe_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            main.QuanLyXe.Visible = true;
            main.QuanLyXe.fQuanlyxe_Load(null, null);
        }

        private void ttQuanLyTinNhan_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            main.QuanLyTinNhan.fQuanlytinnhan_Load(null, null);
            main.QuanLyTinNhan.Visible = true;
        }

        private void picExit_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            main.Visible = true;
        }

        private void ttLich_Click(object sender, EventArgs e)
        {
            //System.Diagnostics.Process.Start("calendar");
        }

        private void fHethong_Load(object sender, EventArgs e)
        {
            main.ThongBaoTinNhanCanGui.ShowDialog();
        }

        private void picDicconnect_Click(object sender, EventArgs e)
        {
            main.ThongBaoTinNhanCanGui.Visible = true;
            this.Visible = false;
        }

        private void ttHuongDan_Click(object sender, EventArgs e)
        {
            try
            {
                //Process k = new Process();
                //k.StartInfo.FileName = "C:\\Users\\PHUNGUYEN\\Desktop\\Year 3\\PM\\New folder\\SMS\\SMS\\PoD.doc";
                //k.StartInfo.Arguments = "";
                //k.Start();
                System.Diagnostics.Process prc = new System.Diagnostics.Process();
                string currentDir = Environment.CurrentDirectory;//lấy đường dẫn thư mục hiện tại.
                prc.StartInfo.FileName = currentDir + "\\PoD\\User Guide SMS_SYSTEM.pdf";
                prc.Start();
            }
            catch(Exception ex)
            {
                MessageBox.Show("Không thể mở file!");
            }
        }

        private void ttAbout_Click(object sender, EventArgs e)
        {
            try
            {
                System.Diagnostics.Process prc = new System.Diagnostics.Process();
                string currentDir = Environment.CurrentDirectory;//lấy đường dẫn thư mục hiện tại.
                prc.StartInfo.FileName = currentDir + "\\PoD\\PoD.html";
                prc.Start();
            }
            catch(Exception ex)
            {
                MessageBox.Show("Không thể mở file!");
            }
        }

        

    }
}
